﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PUCP.SI2.SGIRP.GUI;

namespace PUCP.SI2.SGIRP.GUI
{
    public partial class PrincipalForm : Form
    {
        LoginForm refLoginf = null;
        public PrincipalForm()
        {
            InitializeComponent();
        }

        public void SetRefLogin(LoginForm vLog)
        {
            refLoginf = vLog;
        }

        private void PrincipalForm_Load(object sender, EventArgs e)
        {

        }

       

        //private void btnSalir_Click(object sender, EventArgs e)
        //{
        //    DialogResult result;
        //    result = MessageBox.Show("Está seguro que desea cerrar sesión?", "Cerrar Sesión",
        //        MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
        //    if (result == System.Windows.Forms.DialogResult.Yes)
        //    {
        //        //refLoginf.limpiar();
        //        refLoginf.Show();
        //        this.Dispose();
        //    }

        //}

        private void PrincipalForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult result;
            result = MessageBox.Show("Está seguro que desea cerrar sesión?", "Cerrar Sesión",
                MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                //refLoginf.limpiar();
                
                this.Dispose();
                refLoginf.Close();
            }
            else e.Cancel = true;
        }

        private void CerrarTodosMDIChildren()
        {

        }
        private void contratosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ContratoMenuForm vContratoMenu = new ContratoMenuForm();
            vContratoMenu.MdiParent = this;
            vContratoMenu.Show();
        }

        private void tsmCentroComercial_Click(object sender, EventArgs e)
        {
            MantenimientoCCForm vCentroComercial = new MantenimientoCCForm();
            vCentroComercial.MdiParent = this;
            vCentroComercial.Show();
        }

        private void tsmLocales_Click(object sender, EventArgs e)
        {
            LocalMenuForm vLocal = new LocalMenuForm();
            vLocal.MdiParent = this;
            vLocal.Show();
        }

        private void tsmClientes_Click(object sender, EventArgs e)
        {
            ClienteMenuForm vCliente = new ClienteMenuForm();
            vCliente.MdiParent = this;
            vCliente.Show();
        }

        private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

    }
}
